# name : Generates all permutations
# key : allperm.
# contributor: Shuguang Sun
# --
data _null_;
   array x [4] $3 ('ant' 'bee' 'cat' 'dog');
   n=dim(x);
   nfact=fact(n);
   do i=1 to nfact;
      call allperm(i, of x[*]);
      put i 5. +2 x[*];
   end;
run;